package api_auth

import (
	"github.com/gin-gonic/gin"
	"wrblog-api-go/app/common/token"
	"wrblog-api-go/app/service"
	"wrblog-api-go/pkg/request"
	"wrblog-api-go/pkg/result"
)

// @Tags  Auth - 认证授权
// @Summary  登录接口（加密）
// @Accept json
// @Produce json
// @Param registerForm body token.RegisterForm true "registerForm"
// @Success 200 {object} result.Result "OK"
// @Router /auth/registerKey [post]
func ApiRegisterKey(c *gin.Context) {
	raw, _ := c.Get(request.BindObj)
	registerForm := raw.(token.RegisterForm)
	result.Res(true, service.RegisterKey(registerForm)).Json(c)
}
